/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: GaoBo
 * Date: 2021-04-25
 * Time: 18:34
 */
public class TestDemo {

    public static void main(String[] args) {
        //顺序表的对象
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(0,1);
        myArrayList.add(1,2);
        myArrayList.add(2,3);
        myArrayList.add(3,4);
        myArrayList.add(4,5);
        myArrayList.add(5,6);
        myArrayList.add(6,99);
        myArrayList.display();
        System.out.println("=============");
        myArrayList.remove(99);
        myArrayList.display();

        /*int index = myArrayList.search(99);
        System.out.println(index);*/

       /* System.out.println(myArrayList.search(99));
        System.out.println(myArrayList.contains(299));
*/
        /*int ret = myArrayList.getPos(3);
        if(ret == -1) {
            System.out.println("pos位置不合法！");
        }else {
            System.out.println("3号位置："+ret);
        }*/
       /* try {
            int ret = myArrayList.getPos2(9);
            System.out.println(ret);
        }catch ( UnsupportedOperationException e) {
            e.printStackTrace();
        }*/
    }
}
